@extends('user.base.index')
@section('sidebar')
@stop

@section('content')
    <!-- Responsive Table -->
    <h4 class="page-title">推荐商品管理</h4>
    <div class="block-area" id="responsiveTable">
        <h3 class="block-title">商品表</h3>
        <form action='/admin/recommend/create' method='get'>
            <div class='media-body'>
                商品名称：<input type='text' class='form-control m-b-5' name='name'>
            </div>
            <input type='submit' class='btn' value='搜索'>
        </form>
        
            <div class="table-responsive overflow">
                <table class="table tile">
                    <thead>
                        <tr>
                            <th>No.</th>
                            <th>商品名称</th>
                            <th>商品类别</th>
                            <th>商品图片</th>
                            <th>商品原价</th>
                            <th>当当价</th>
                            <th>操作</th>
                        </tr>
                    </thead>
                    <tbody>
                    @foreach ($pro as $v)
                    <form action='/admin/recommend' method='post' name='myform'>
                        <input type='hidden' name='_token' value='{{ csrf_token() }}'>
                        <input type='hidden' name='product_id' value='{{ $v->id }}'>
                        <tr>
                            <td>{{ $v->id }}</td>
                            <td>{{ $v->name }}</td>
                            <td>{{ $v->keywords }}</td>
                            <td><img src="{{ asset('images').'/'.$v->picture }}" width="50px"></td>
                            <td>{{ $v->fixed_price }}</td>
                            <td>{{ $v->lower_price }}</td>
                            <td>
                                <input type='submit' class='btn' value='添加到推荐商品'>
                            </td>
                        </tr>
                    </form>
                    @endforeach
                    </tbody>
                </table>
                {{ $pro->appends($where)->links() }}
            </div>
        
    </div>
@stop

